<%@ page pageEncoding="utf-8"%>
<%@page import="com.frame.common.SystemConfig"%>
<%String path=request.getContextPath(); %>

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="keywords" content="10" />
<meta name="description" content="0" />
<title><%=SystemConfig.getInstance().getTitle() %>-用户登录</title>
<link rel="stylesheet" href="<%=path %>/platform/login.css" />
<link rel="stylesheet" type="text/css" href="<%=path %>/util/js/easyui-1.3.3/themes/default/easyui.css">
<script type="text/javascript" src="<%=path %>/util/js/jquery.js"></script>
<script type="text/javascript" src="<%=path %>/util/js/easyui-1.3.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=path %>/util/js/easyui-1.3.3/locale/easyui-lang-zh_CN.js" charset="utf-8"></script>
<script>var ctx="<%=path%>";</script>
<script>
 $(function(){
	 	document.all.loginName.focus();
})
function ok(){
	$("#loginmsg").html("&nbsp;");
	var mform=$('#loginForm');
	if(!mform.form("validate"))
		return false;
	$("#loginmsg").html("<font style='color:#1AB394'>正在登录中...</font>");
	$.ajax({
		type: 'POST',
		url:mform.attr("action"),
		data:mform.serializeArray(),
		dataType:"json",
		cache: false,
		success: okback,
		error: function(){alert("服务器连接失败！");}
	});
}
function okback(data){
	if(data.state=='noname')
		$("#loginmsg").html("<font style='color:red'>用户不存在</font>");
	else if(data.state=='nopwd')
		$("#loginmsg").html("<font style='color:red'>密码不存在</font>");
	else if(data.state=='ok'){
		window.location.href=ctx+"/platform/UI/index.jsp";
	}else
		$("#loginmsg").html("<font style='color:red'>"+data.state+"</font>");
}
$(document).keydown(function(event){if (event.keyCode == 13){ok();}});
</script>
</head>

<body>
<!-- content----------start -->
<div class="login_all">
	<div class="login_con">
		<div id="loginmsg" class="loginmsg"></div>
		<form id="loginForm" name="loginForm" action="<%=path %>/platform/user/UserLoginPage.page" method="post" style="margin:0px;">
  		<div class="login_con_con">
			<p>
				<input name="loginName" type="text" placeholder="用户" class="easyui-validatebox" required="true"/>
				<i class="login_icon1"></i>
			</p>
			<p style="margin-top:18px;">
				<input name="loginPwd" type="password" placeholder="密码" class="easyui-validatebox" required="true"/>
				<i class="login_icon2"></i>
			</p>
			<p style="margin-top:18px;">
				<input type="button" value="登录" class="login_btn" onclick="ok()"/>
			</p>
		</div>
		</form>
	</div>
	<div class="login_footer"></div>
	<div class="login_con_foot">
		<p>技术支持：B2B技术团队</p>
	</div>
</div>
<!-- content----------end -->
</body>
</html>
